package com.example.userinfoservice.convert;

import com.example.blogcommon.utils.SecurityUtil;
import com.example.userinfoapi.request.UserInfoRegisterRequest;
import com.example.userinfoservice.dataobject.UserInfo;

public class BeanConvert {
    public static UserInfo convertUserInfoByEncrypt (UserInfoRegisterRequest registerRequest) {
        UserInfo userInfo = new UserInfo();
        userInfo.setUserName(registerRequest.getUserName());
        userInfo.setPassword(SecurityUtil.encrypt(registerRequest.getPassWord()));
        userInfo.setGithubUrl(registerRequest.getGithubUrl());
        userInfo.setEmail(registerRequest.getEmail());
        return userInfo;

    }
}
